package com.ezcloud.engine.server;


public class NettyServerOptions {
    public static final NettyServerOptions DEFAULT = new NettyServerOptions();

    private int backlog = 511;
    /**
     * bind processer 数量
     */
    private int workers = 2;
    /**
     * tcp keep idle , 300 秒
     */
    private int tcpKeepIdle = 300;

    private int bossThreads = 2;

    private int workerThreads = 4;

    private int eventThreads = 8;

    private int sendBuf = 65535;

    private int recvBuf = 65535;

    public NettyServerOptions() {
    }

    public int getBacklog() {
        return backlog;
    }

    public void setBacklog(int backlog) {
        this.backlog = backlog;
    }

    public int getWorkers() {
        return workers;
    }

    public int getTcpKeepIdle() {
        return tcpKeepIdle;
    }

    public void setTcpKeepIdle(int tcpKeepIdle) {
        this.tcpKeepIdle = tcpKeepIdle;
    }

    public void setWorkers(int workers) {
        this.workers = workers;
    }

    public int getBossThreads() {
        return bossThreads;
    }

    public void setBossThreads(int bossThreads) {
        this.bossThreads = bossThreads;
    }

    public int getWorkerThreads() {
        return workerThreads;
    }

    public void setWorkerThreads(int workerThreads) {
        this.workerThreads = workerThreads;
    }

    public int getEventThreads() {
        return eventThreads;
    }

    public void setEventThreads(int eventThreads) {
        this.eventThreads = eventThreads;
    }

    public int getSendBuf() {
        return sendBuf;
    }

    public void setSendBuf(int sendBuf) {
        this.sendBuf = sendBuf;
    }

    public int getRecvBuf() {
        return recvBuf;
    }

    public void setRecvBuf(int recvBuf) {
        this.recvBuf = recvBuf;
    }

    @Override
    public String toString() {
        return "NettyServerOptions{" +
                "backlog=" + backlog +
                ", workers=" + workers +
                ", tcpKeepIdle=" + tcpKeepIdle +
                ", bossThreads=" + bossThreads +
                ", workerThreads=" + workerThreads +
                ", eventThreads=" + eventThreads +
                ", sendBuf=" + sendBuf +
                ", recvBuf=" + recvBuf +
                '}';
    }
}
